import {reactive,getCurrentInstance} from "vue"
import useTable from "@/views/system/dept/hooks/useTable";
export interface SearchForm{
    deptName?: string;
    dataStatus?: number;
}
export const searchForm = reactive<SearchForm>({
    deptName:"",
    dataStatus:undefined
})
function useSearch() {
    const instance = getCurrentInstance()
    const { getDataList} = useTable()
    function handlerSearch() {
        getDataList()
    }
    function resetSearchForm() {
        // eslint-disable-next-line
        (instance?.refs.searchFormRef as any).resetFields()
        getDataList()
    }
    return {
        searchForm,
        resetSearchForm,
        handlerSearch
    }
}
export default useSearch
